package cc.lj.internal.coupons.interfaces.dto.convert;

import cc.lj.internal.api.coupons.dto.TicketPayRecordApiDTO;
import cc.lj.internal.api.coupons.dto.command.TicketPayRecordApiUpdateCommand;
import cc.lj.internal.api.coupons.dto.querty.TicketPayRecordApiQuery;
import cc.lj.internal.coupons.domain.ticket.model.vo.TicketPayRecordDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 合同收券表DO与DTO转换
 * @author liangxifeng
 * @date 2022-01-13
 */
@Mapper
public interface TicketPayRecordDTOConvertDO {
    TicketPayRecordDTOConvertDO INSTANCE = Mappers.getMapper(TicketPayRecordDTOConvertDO.class);

    //dto to do
    TicketPayRecordDO convert(TicketPayRecordApiQuery ticketPayRecordDTO);

    //do to dto
    TicketPayRecordApiDTO convert(TicketPayRecordDO ticketPayRecordDO);

    @Mapping(target = "pactNumber",ignore = true)
    @Mapping(target = "grantType",ignore = true)
    @Mapping(target = "ticketUsecode",ignore = true)
    @Mapping(target = "ticketBatchId",ignore = true)
    @Mapping(target = "ticketPrice",ignore = true)
    @Mapping(target = "recordDate",ignore = true)
    TicketPayRecordDO convert(TicketPayRecordApiUpdateCommand payRecordApiUpdateCommand);
}
